// Author: Domien Nowicki

#ifndef SINGLEGAMEWIDGET_H
#define SINGLEGAMEWIDGET_H

#include <QWidget>
#include <QHboxLayout>
#include <QGridLayout>
#include <QTextEdit>
#include <QLCDNumber>
#include <QBasicTimer>
#include <QLabel>
#include "SingleGame.h"
#include "Map.h"
#include "MapWidget.h"
#include "HumanPlayerWidget.h"
#include "PaintPaletteWidget.h"
#include "ClockWidget.h"

class SingleGameWidget: public QWidget, public SingleGame
{
	Q_OBJECT
public:

	// Constructors
	SingleGameWidget(QWidget *parent, const Map& newMap, const Properties& properties, Highscore& highscore);

	// Destructor
	virtual ~SingleGameWidget();




protected:
	// Overloaded new components allocation
	virtual Player* NewHumanPlayer(Map* map);
	virtual Map* NewMap(const Map& map);
	virtual Clock* NewClock(Clock::ClockType type);

	// Overloaded operations
	virtual void Output(std::string message);
	virtual bool GetName(std::string *name);
	virtual int GetNumber(int min, int max);
	virtual void ShowHighscore(const Highscore& highscore);
	virtual void ShowPlayerStepCount(int steps);
	virtual ColorMapMethod ShowMove(const Move& move);
	virtual void Started();
	virtual void Stopped();


signals:
	void started(Game* game);
	void stopped();

private slots:
private:
	QGridLayout *gridLayout;
	QHBoxLayout *hboxLayout, *topHboxLayout;

    QTextEdit *textEdit;
	QBasicTimer timer;
	QLabel *labelStepCount;

};

#endif //SINGLEGAMEWIDGET_H